<?php
    include_once "conn.php";
    //查询代码
    $sql = "select * from user where groups = 1";
    $query = mysqli_query($conn,$sql);
    while($row = mysqli_fetch_array($query)){
        if($row['name'] == $_POST['account'] && $row['password'] == md5($_POST['password'])){
            setcookie("name",$row['name']);
            setcookie("password",$row['password']);
?>
<frameset cols="25%,75%">
    <frame src="left.php">
    <frame src="welcome.php" name='main'>
</frameset>
<?php
        }else{
            echo '<script>window.location.href = "login.php";</script>';
        }
    }
?>

